iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 20
0
Software Development

Linux從零開始系列 第 20

Linux從零開始(20/30): 磁碟和分割槽檢視

  • 分享至 

  • xImage
  •  

磁碟和分割槽檢視

檢視掛接的分割槽狀態: mount|column -t

[root@localhost test]# mount|column -t
sysfs                    on  /sys                        type  sysfs            (rw,nosuid,nodev,noexec,relatime,seclabel)
proc                     on  /proc                       type  proc             (rw,nosuid,nodev,noexec,relatime)
devtmpfs                 on  /dev                        type  devtmpfs         (rw,nosuid,seclabel,size=485140k,nr_inodes=121285,mode=755)
securityfs               on  /sys/kernel/security        type  securityfs       (rw,nosuid,nodev,noexec,relatime)
tmpfs                    on  /dev/shm                    type  tmpfs            (rw,nosuid,nodev,seclabel)
devpts                   on  /dev/pts                    type  devpts           (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
tmpfs                    on  /run                        type  tmpfs            (rw,nosuid,nodev,seclabel,mode=755)
tmpfs                    on  /sys/fs/cgroup              type  tmpfs            (ro,nosuid,nodev,noexec,seclabel,mode=755)
cgroup                   on  /sys/fs/cgroup/systemd      type  cgroup           (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore                   on  /sys/fs/pstore              type  pstore           (rw,nosuid,nodev,noexec,relatime)
cgroup                   on  /sys/fs/cgroup/net_cls      type  cgroup           (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup                   on  /sys/fs/cgroup/freezer      type  cgroup           (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup                   on  /sys/fs/cgroup/cpuset       type  cgroup           (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup                   on  /sys/fs/cgroup/cpu,cpuacct  type  cgroup           (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup                   on  /sys/fs/cgroup/blkio        type  cgroup           (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup                   on  /sys/fs/cgroup/devices      type  cgroup           (rw,nosuid,nodev,noexec,relatime,devices)
cgroup                   on  /sys/fs/cgroup/hugetlb      type  cgroup           (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup                   on  /sys/fs/cgroup/memory       type  cgroup           (rw,nosuid,nodev,noexec,relatime,memory)
cgroup                   on  /sys/fs/cgroup/perf_event   type  cgroup           (rw,nosuid,nodev,noexec,relatime,perf_event)
configfs                 on  /sys/kernel/config          type  configfs         (rw,relatime)
/dev/mapper/centos-root  on  /                           type  xfs              (rw,relatime,seclabel,attr2,inode64,noquota)
selinuxfs                on  /sys/fs/selinux             type  selinuxfs        (rw,relatime)
systemd-1                on  /proc/sys/fs/binfmt_misc    type  autofs           (rw,relatime,fd=30,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
debugfs                  on  /sys/kernel/debug           type  debugfs          (rw,relatime)
mqueue                   on  /dev/mqueue                 type  mqueue           (rw,relatime,seclabel)
hugetlbfs                on  /dev/hugepages              type  hugetlbfs        (rw,relatime,seclabel)
sunrpc                   on  /var/lib/nfs/rpc_pipefs     type  rpc_pipefs       (rw,relatime)
nfsd                     on  /proc/fs/nfsd               type  nfsd             (rw,relatime)
/dev/sda1                on  /boot                       type  xfs              (rw,relatime,seclabel,attr2,inode64,noquota)
tmpfs                    on  /run/user/1000              type  tmpfs            (rw,nosuid,nodev,relatime,seclabel,size=100136k,mode=700,uid=1000,gid=1000)
gvfsd-fuse               on  /run/user/1000/gvfs         type  fuse.gvfsd-fuse  (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
fusectl                  on  /sys/fs/fuse/connections    type  fusectl          (rw,relatime)
/dev/sr0                 on  /run/media/test/CentOS      7     x86_64           type                                                                                                       iso9660  (ro,nosuid,nodev,relatime,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500,uhelper=udisks2)
tmpfs                    on  /run/user/0                 type  tmpfs            (rw,nosuid,nodev,relatime,seclabel,size=100136k,mode=700)
[root@localhost test]# 

檢視所有分割槽:fdisk -l

[root@localhost test]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O 大小 (最小/最佳化):512 位元組 / 512 位元組
Disk label type: dos
磁碟識別碼:0x000688da

所用裝置 開機      開始         結束      區塊   識別號  系統
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    41943039    20458496   8e  Linux LVM

Disk /dev/mapper/centos-root: 18.8 GB, 18756927488 bytes, 36634624 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O 大小 (最小/最佳化):512 位元組 / 512 位元組


Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O 大小 (最小/最佳化):512 位元組 / 512 位元組

[root@localhost test]# 

檢視所有交換分割槽:swapon -s

[root@localhost test]# swapon -s
Filename				Type		Size	Used	Priority
/dev/dm-1                              	partition	2097148	8248	-1
[root@localhost test]# 

檢視磁碟引數(僅適用於IDE裝置): hdparm -i /dev/hda

[root@localhost test]# hdparm -i /dev/hda
bash: hdparm: 找不到指令...
[root@localhost test]# 

檢視啟動時IDE裝置檢測狀況:dmesg|grep IDE

[root@localhost test]# dmesg|grep IDE
[    0.401278] pci 0000:00:07.1: legacy IDE quirk: reg 0x10: [io  0x01f0-0x01f7]
[    0.401281] pci 0000:00:07.1: legacy IDE quirk: reg 0x14: [io  0x03f6]
[    0.401283] pci 0000:00:07.1: legacy IDE quirk: reg 0x18: [io  0x0170-0x0177]
[    0.401284] pci 0000:00:07.1: legacy IDE quirk: reg 0x1c: [io  0x0376]
[    3.819253] ata2.00: ATAPI: VMware Virtual IDE CDROM Drive, 00000001, max UDMA/33
[    3.847532] scsi 1:0:0:0: CD-ROM            NECVMWar VMware IDE CDR10 1.00 PQ: 0 ANSI: 5
[    3.944604] scsi target2:0:0: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)
[root@localhost test]# 


上一篇
Linux從零開始(19/30): 資源檢視
下一篇
Linux從零開始(21/30): 網路檢視
系列文
Linux從零開始30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言